package com.lywz.biz.common.entity.example;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.lywz.core.entity.AbstractEntity;
import com.lywz.core.entity.EntityAnnotation;
/**
 * 基因实体类
 * @author yangbl
 * date 2010-4-25
 */
@Entity
@EntityAnnotation
@Table(name = "test_gene")
public class Gene extends AbstractEntity {

	private static final long serialVersionUID = 6318360280557773399L;
	@Id
	@GenericGenerator(name = "foreigner", strategy = "foreign", parameters = { @Parameter(name = "property", value = "user") })
	@GeneratedValue(generator = "foreigner")
	private Integer id;
	private String gene;
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	private TUser user;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getGene() {
		return gene;
	}

	public void setGene(String gene) {
		this.gene = gene;
	}

	public TUser getUser() {
		return user;
	}

	public void setUser(TUser user) {
		this.user = user;
	}

}
